<?php if($this->projects) : ?>
	<table id="view-table" cellspacing="0" align="center"  width="100%" summary="View Hotel">
	<tr>
	<th width="200px">Image</th>		
	<th width="200px">Title</th>		
	<th width="200px">Requested</th>		
	<th width="200px">Description</th>		
	<th width="200px">User</th>		
	<th width="200px">Full Info</th>
	<th width="200px">Votes</th>		
	<th width="200px">Vote</th>		
	</tr>
	<?php foreach ($this->projects as $project):?>
		<?php
			// generate the image thumbnail
			if (!$project->favorite_picture) {
				$project->favorite_picture = 'no-photo.jpg';
			}
			$file = IMAGE_PATH."\\".$project->favorite_picture;
			$fileThumb = IMAGE_PATH."\\thumbs\\".$project->favorite_picture;
			$this->imageThumbnail($file, $fileThumb, 150, 150); 
		?>  
		<tr style="background-color:<?php echo $this->cycle(array("#F0F0F0","#FFFFFF"))->next()?>">
		<td><img src="<?php echo $this->escape($this->baseUrl().'/images/thumbs/'.$project->favorite_picture) ?>" ></td>
		<td><a href="<?php echo $this->escape($this->linkTo('view','project',null, array('id' => $project->id_project))) ?>"><?php echo $this->escape($project->title) ?></a></td>
		<td><?php echo $this->escape($project->funds) ?></td>
		<td><?php echo $this->escape($this->getWords($project->description, 20)) ?></td>
		<td><?php echo $this->escape($project->Users->username) ?></td>
		<td><a href="<?php echo $this->escape($this->linkTo('view','project',null, array('id' => $project->id_project))) ?>">Full Info</a></td>
		<td><?php echo $this->escape($project->num_votes) ?></td>
		<td><a href="<?php echo $this->escape($this->linkTo('pick','election',null, array('id' => $project->id_project))) ?>">Vote</a></td>
		</tr>
	<?php endforeach;?>	
	</table>
<?php endif;?>
